﻿using System;
using System.Collections;
using System.Collections.Generic;

namespace SmallStepSemanticCsharp
{
    class Program
    {
        static void Main(string[] args)
        {
            // Exp exp = new Add(new Num(1),new Num(2));

            Exp exp = new Add(new Add(new Num(1), new Num(2)),
                            new Add(new Num(3), new Num(4)));

            var env = new Dictionary<string, int>();
            var machine = new Machine(new Assign("x", exp),env);

            machine.run();

        }
        public static int eval(Exp exp, Dictionary<string, int> env)
        {
            while (exp.reducible())
            {
                exp = exp.reduce(env);
            }

            return exp.Val;
        }
    }
}
